#include<stdio.h>

void swap(int* x, int* y)
{
	int tmp = *x;
	*x = *y;
	*y = tmp;
}

void BubbleSort(int* a, int n)
{
	for (int i = n; i >= 0; i--)
		for (int j = 0; j < i - 1; j++)
			if (a[j] > a[j + 1])
				swap(&a[j], &a[j + 1]);
		
}

int main()
{
	int arr[10] = { 2, 5, 8, 3, 2, 1, 6, 7, 9, 8 };
	BubbleSort(arr, sizeof(arr) / sizeof(int));
	for (int i = 0; i < sizeof(arr) / sizeof(int); i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}